<%--
  Created by IntelliJ IDEA.
  User: 57998
  Date: 2020/10/28
  Time: 21:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	pageContext.setAttribute("APP_PATH", request.getContextPath());
%>

<html>
	<head>
		<meta charset="UTF-8">
		<script type="text/javascript" class="autoinsert" src="${APP_PATH }/js/jquery-2.2.0.min.js"></script>
		<!-- bootstrap规定使用前置设置 -->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link href="${APP_PATH }/bootstrap-3.3.7-dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="${APP_PATH }/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
		<link rel="stylesheet" href="${APP_PATH }/font-awesome-4.7.0/css/font-awesome.min.css">
		<link rel="stylesheet" type="text/css" href="${APP_PATH }/css/houtai_userinfo.css" />
		<script type="text/javascript" class="autoinsert" src="${APP_PATH }/js/layer.js"></script>
		<link rel="stylesheet" type="text/css" href="${APP_PATH }/css/layer.css" />
		<title>时长信息</title>
	</head>
	<body>

		<%@ include file="houtai_left.jsp"%>
		<%@ include file="houtai_top.jsp"%>

		<input type="hidden" id="show_left" value="${show_left}" />
		<script type="text/javascript">
			$("div[id*='left_y']").hide();
			var now_left = $("#now_left").val();
			$("#" + now_left).show();
			var show_left = $("#show_left").val();
			$("#" + show_left).attr("style", "background: #293038;");
		</script>

		<div class="main">

			<div class="main_top">
				<h5 class="main_top_text">查看时长信息</h5>
			</div>

			<form action="${pageContext.request.contextPath}/houtai/searchlooktime" method="post" name="form_search">
				<div class="main_search">
					<select name="types" class="main_search_text">
						<option value="1">用户名</option>
						<option value="2">电影名</option>
					</select>
					<input type="text" name="keyword" id="keyword" value="" />
					<button class="main_search_button" onclick="to_search()"><a href="#" class="main_search_a"><i class="fa fa-search"></i>搜索</a></button>
				</div>
			</form>

			<script type="text/javascript">
				function to_search() {
					form_search.submit();
				}
			</script>

			<div class="main_show">

				<table class="table table-hover">
					<thead>
						<tr>
							<th>ID</th>
							<th>用户名</th>
							<th>电影名</th>
							<th>观看时长(秒)</th>
						</tr>
					</thead>
					<input type="hidden" id="nosearch" value="${nosearch}" />
					<script type="text/javascript">
						console.log($("#nosearch").val());
						if ($("#nosearch").val() == "nosearch") {
							layer.msg('无此搜索项!', {
								time: 2000
							});
						}
					</script>
					<c:forEach var="U" items="${looktime}">
						<tbody>
							<tr>
								<td>${U.id}</td>
								<td>${U.uname}</td>
								<td>${U.fname}</td>
								<td>${U.time_temp}</td>
								<td>
									<a href="${pageContext.request.contextPath}/houtai/to_updatelooktime?userid=${U.id}" class="main_show_delete" style="margin-right: 15px;">编辑</a>
									<a href="${pageContext.request.contextPath}/houtai/deletelooktime?userid=${U.id}" class="main_show_delete">删除</a>
								</td>
							</tr>
					</c:forEach>
					<tbody>
				</table>
				<br><br>
				
			</div>

		</div>

		<%@ include file="houtai_page.jsp"%>

	</body>
</html>

